<extend name="layout/edit" />

<block name="CONTENT">
    <div style="padding: 10px;height: 100%;">
        <control:Form id="form"/>
    </div>
</block>

<block name="FOOTER">
   <script type="text/javascript">
    var  page=(function(ns){
        
        
         //页面初始化
        ns.init=function(){
            $("#sms_link").parent().attr('id','sms_url');
            ns.setSmsLink();
        }
        
        ns.setSmsLink=function(){
            if(form.getValue('type') == 'kuaidi100'){
                $("#sms_url").html("<a class='link' target='_target' href='https://api.kuaidi100.com/login'>去获取https://api.kuaidi100.com/login</a>");
            } else{
                $("#sms_url").html("");
            }
        }
        
        //保存
        ns.save=function(){
            var data = form.getData();
            if(!data) return false;
            $.ajaxs("/admin/soft/param/saveTextParamValue",{
                param_scope:'系统基础配置',
                param_code:'system_base_config_kuaidi',
                param_value: JSON.stringify(form.getData())
            }).then(function(res){
                $.toast(1,'保存成功！');
            });
        }
        
        return ns;
    }({}));
    
    //加载当前页面需要的控件和配置
    $(function(){  page.init();  });
   </script>
</block>



<block name="HEADER">
   <style type="text/css">
        .xw-form .xw-btnRow{
           text-align: left !important;
            padding-left: 180px !important;
            background: none; 
            border: none;
        }
        .xw-form .layui-tab .layui-tab-title li{
            font-weight:100 ;
        }
        .link{   line-height: 30px; }
   </style>
</block>